package io.xccit.race.service.impl;

import java.util.List;
import io.xccit.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import io.xccit.race.mapper.RaceUniversityMapper;
import io.xccit.race.domain.RaceUniversity;
import io.xccit.race.service.IRaceUniversityService;

/**
 * 高校信息Service业务层处理
 * 
 * @author xccit
 * @date 2025-10-8
 */
@Service
public class RaceUniversityServiceImpl implements IRaceUniversityService 
{
    @Autowired
    private RaceUniversityMapper raceUniversityMapper;

    /**
     * 查询高校信息
     * 
     * @param id 高校信息主键
     * @return 高校信息
     */
    @Override
    public RaceUniversity selectRaceUniversityById(Long id)
    {
        return raceUniversityMapper.selectRaceUniversityById(id);
    }

    /**
     * 查询高校信息列表
     * 
     * @param raceUniversity 高校信息
     * @return 高校信息
     */
    @Override
    public List<RaceUniversity> selectRaceUniversityList(RaceUniversity raceUniversity)
    {
        return raceUniversityMapper.selectRaceUniversityList(raceUniversity);
    }

    /**
     * 新增高校信息
     * 
     * @param raceUniversity 高校信息
     * @return 结果
     */
    @Override
    public int insertRaceUniversity(RaceUniversity raceUniversity)
    {
        if (raceUniversity.getDelFlag() == null) {
            raceUniversity.setDelFlag("0");
        }
        raceUniversity.setCreateTime(DateUtils.getNowDate());
        return raceUniversityMapper.insertRaceUniversity(raceUniversity);
    }

    /**
     * 修改高校信息
     * 
     * @param raceUniversity 高校信息
     * @return 结果
     */
    @Override
    public int updateRaceUniversity(RaceUniversity raceUniversity)
    {
        raceUniversity.setUpdateTime(DateUtils.getNowDate());
        return raceUniversityMapper.updateRaceUniversity(raceUniversity);
    }

    /**
     * 批量删除高校信息
     * 
     * @param ids 需要删除的高校信息主键
     * @return 结果
     */
    @Override
    public int deleteRaceUniversityByIds(Long[] ids)
    {
        return raceUniversityMapper.deleteRaceUniversityByIds(ids);
    }

    /**
     * 删除高校信息信息
     * 
     * @param id 高校信息主键
     * @return 结果
     */
    @Override
    public int deleteRaceUniversityById(Long id)
    {
        return raceUniversityMapper.deleteRaceUniversityById(id);
    }
}
